package net.suncaper.demo.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import net.suncaper.demo.service.HotelManageService;
import net.suncaper.demo.domain.hotel_information;
import java.util.List;

@RestController
@RequestMapping("/api/v1/user")
public class RestHotelManageController {
    @Autowired
    private HotelManageService hotelManageService;

    @GetMapping("/api/user")
    public List<hotel_information> listAllHotel_informations() {
        return hotelManageService.findUser(null);
    }

    @GetMapping("/delete")
    public boolean deleteUser(@RequestParam("hotel_id")int hotel_id) {

        int count= hotelManageService.deletehotel_informationById(hotel_id);
        return count> 0 ? true : false;
    }
}
